class Team < ActiveRecord::Base
  belongs_to :project
  belongs_to :person 
  has_many :owners
  has_many :team_members, :through => :owners, :source => :person
  
  #Teams are identified by their managers

  def count
    self.owners.count
  end

  def manager
    self.person
  end

 
  ##
  # this field is needed in order for the view to be able to 
  # accept a username when creating a team
  # rails wants us to use fields from the model, but  we really don't
  # want to tie this to the nested model at that point...
  # we need to run a bunch of logic before creating the team object
  def username
  end

  ##
  # this field is needed in order for the view to be able to 
  # accept a username when creating a team
  # rails wants us to use fields from the model, but this field is
  # not part of the model
  def use_directory
  end
  
  
end
